<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>for...in 遍历对象的属性</title>
</head>
<body>


    <script>
        
        let books = {};

        
        books["book1"] = "《JavaScript前端开发案例教程》";
        books["book2"]= "《Node.js核心基础教程》";
        books["book3"] = "《HTML5移动Web开发》";

      
        document.write("<ul>");
        for (let key in books) {
            document.write("<li>" + key + ": " + books[key] + "</li>");
        }
        document.write("</ul>");
    </script>
</body>
</html>